package com.xiaolin.spring.xml;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @ClassName InnerTest
 * @Description TODO
 * @Detail 内部类装配
 * @Author MyPC
 * @Date 2020/10/27
 * @Version 1.0
 */
public class InnerTest {

    private Inner inner;

    public void setInner(Inner inner) {
        this.inner = inner;
    }

    public Inner getInners() {
        return inner;
    }

    public class Inner{

        public String name;
        public Integer age;

        public void setName(String name) {
            this.name = name;
        }

        public void setAge(Integer age) {
            this.age = age;
        }
    }

    public static void main(String[] args) {
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext("inner.xml");
        InnerTest outer = applicationContext.getBean("outer", InnerTest.class);
        System.out.println(outer.inner);
    }
}
